﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace ARS.PublicTool.WebHelper
{
    public class ConfigHelper
    {
        /// <summary>
        /// 根据传入的Key获取配置文件中的Value值
        /// </summary>
        /// <param name="Key"></param>
        /// <returns></returns>
        public static string GetConfigValueByKey(string Key)
        {
            try
            {
                return ConfigurationManager.AppSettings[Key].ToString();
            }
            catch
            {
                throw new Exception("web.config中 Key=\"" + Key + "\"未配置或配置错误！");
            }
        }
    }
}
